# !/usr/bin/python3
# -*- coding: utf-8 -*-

"""
日志信息表模型类
----------------------------------------------------
@Project :   xinhou-openai-framework
@File    :   Logs.py
@Contact :   sp_hrz@qq.com

@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2023/04/16 22:04  peng.shen   v1.0.0     None
"""

from datetime import datetime
from typing import Optional

from pydantic import BaseModel, Field


class ReqLogsFindSchema(BaseModel):
    """
    日志信息表参数&校验模型
    """

    id: Optional[int] = Field(
        default=None, title="主键ID",
    )

    title: Optional[str] = Field(
        default=None, title="日志标题",
    )

    type: Optional[int] = Field(
        default=None, title="日志类型:0=INFO,1=DEBUG,2=ERROR",
    )

    url: Optional[str] = Field(
        default=None, title="请求地址",
    )

    content: Optional[str] = Field(
        default=None, title="日志内容",
    )

    create_by: Optional[str] = Field(
        default=None, title="创建者",
    )

    created_at: Optional[datetime] = Field(
        default=None, title="创建时间",
    )

    update_by: Optional[str] = Field(
        default=None, title="更新者",
    )

    updated_at: Optional[datetime] = Field(
        default=None, title="更新时间",
    )

    remark: Optional[str] = Field(
        default=None, title="备注",
    )


class ReqLogsSaveSchema(BaseModel):
    """
    日志信息表参数&校验模型
    """

    id: Optional[int] = Field(
        default=None, title="主键ID",
    )

    title: Optional[str] = Field(
        title="日志标题",
    )

    type: Optional[int] = Field(
        title="日志类型:0=INFO,1=DEBUG,2=ERROR",
    )

    url: Optional[str] = Field(
        title="请求地址",
    )

    content: Optional[str] = Field(
        title="日志内容",
    )

    create_by: Optional[str] = Field(
        default=None, title="创建者",
    )

    created_at: Optional[datetime] = Field(
        default=None, title="创建时间",
    )

    update_by: Optional[str] = Field(
        default=None, title="更新者",
    )

    updated_at: Optional[datetime] = Field(
        default=None, title="更新时间",
    )

    remark: Optional[str] = Field(
        default=None, title="备注",
    )


class ReqLogsUpdateSchema(BaseModel):
    """
    日志信息表参数&校验模型
    """

    id: int = Field(
        title="主键ID",
    )

    title: Optional[str] = Field(
        default=None, title="日志标题",
    )

    type: Optional[int] = Field(
        default=None, title="日志类型:0=INFO,1=DEBUG,2=ERROR",
    )

    url: Optional[str] = Field(
        default=None, title="请求地址",
    )

    content: Optional[str] = Field(
        default=None, title="日志内容",
    )

    create_by: Optional[str] = Field(
        default=None, title="创建者",
    )

    created_at: Optional[datetime] = Field(
        default=None, title="创建时间",
    )

    update_by: Optional[str] = Field(
        default=None, title="更新者",
    )

    updated_at: Optional[datetime] = Field(
        default=None, title="更新时间",
    )

    remark: Optional[str] = Field(
        default=None, title="备注",
    )


class ResLogsDetailSchema(BaseModel):
    """
    日志信息表参数&校验模型
    """

    id: Optional[int] = Field(
        default=None, title="主键ID",
    )

    title: Optional[str] = Field(
        default=None, title="日志标题",
    )

    type: Optional[int] = Field(
        default=None, title="日志类型:0=INFO,1=DEBUG,2=ERROR",
    )

    url: Optional[str] = Field(
        default=None, title="请求地址",
    )

    content: Optional[str] = Field(
        default=None, title="日志内容",
    )

    create_by: Optional[str] = Field(
        default=None, title="创建者",
    )

    created_at: Optional[datetime] = Field(
        default=None, title="创建时间",
    )

    update_by: Optional[str] = Field(
        default=None, title="更新者",
    )

    updated_at: Optional[datetime] = Field(
        default=None, title="更新时间",
    )

    remark: Optional[str] = Field(
        default=None, title="备注",
    )
